package com.xbongbong.paas.domain.dao;

import com.xbongbong.paas.domain.entity.StageTimeoutRemindEntity;
import com.xbongbong.paas.domain.entity.StageWorkflowEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 阶段工作流关联
 * @author 李少杰
 * @version v1.0.0
 * @date 2021/11/17 19:33
 */
@Repository
@Mapper
public interface StageWorkflowDao {

    /**
     * 查找实体
     * @param key
     * @param corpid
     * @return
     */
    StageWorkflowEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     * 插入
     * @param entity
     * @return
     */
    Integer insert(StageWorkflowEntity entity);

    /**
     * 更新
     * @param entity
     * @return
     */
    Integer update(StageWorkflowEntity entity);

    /**
     * 条件查询
     * @param param
     * @return
     */
    List<StageWorkflowEntity> findEntitys(@Param("param")Map<String, Object> param) ;

    /**
     * 条件实体数
     * @param param
     * @return
     */
    Integer getEntitysCount(@Param("param")Map<String, Object> param);

    /**
     * 删除
     * @param key
     * @param corpid
     * @return
     */
    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    /**
     * 批量插入
     * @param list
     */
    void insertBatch(List<StageWorkflowEntity> list);

    /**
     * 批量更新
     * @param stageWorkflowEntityList
     * @param corpid
     */
    void updateBatch(@Param("list") List<StageWorkflowEntity> stageWorkflowEntityList, @Param("corpid") String corpid);

    /**
     * 批量删除
     * @param stageWorkflowEntityList
     * @param corpid
     */
    Integer deleteBatch(@Param("list") List<StageWorkflowEntity> stageWorkflowEntityList, @Param("corpid") String corpid);
}
